package cn.tedu.spring.eg3;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

@Component
public class ShopController {
    private String meaning;


    public ShopController() {
        System.out.println("1.构造器阶段执行的代码");
    }

    @Value("2.生命的意义在于享受！")
    public void setMeaning(String meaning) {
        this.meaning = meaning;
        System.out.println("2.set阶段执行的代码");
    }
    @PostConstruct
    public void initbefore(){
        System.out.println("3.初始化指之前执行的方法 下一步初始化");
    }
    @PreDestroy
    public void  destroybefore(){
        System.out.println("5.销毁执行执行的方法 下一步销毁");
    }
}
